<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model app\models\SamplePatient */

$this->title = '查看提取DNA信息';
$dnaOrRna = ($info->xna_type == 1) ? 'dna' : 'rna';

?>
<div class="sample-patient-view">

    <p>
        <?= Html::a('返回', '/sample/view-'.(($info->xna_type == 1) ? 'dna' : 'rna'), ['class' => 'btn btn-success']) ?>

        <?= Html::a('删除', ['delete', 'id' => $info->pk_id], [
            'class' => 'btn btn-danger btn-right',
            'data' => [
                'confirm' => '确定删除?',
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <table class="table table-striped table-bordered detail-view">

        <tr>
            <th>原始管编号</th>
            <td><font color="#bb2222"><b><?= $info->xna_id ?></b></font></td>
            <th>所在冰箱</th>
            <td>-80°C</td>
            <th>所在位置</th>
            <td><?= $info->case.' A('.$info->case_a.', '.$info->case_b.')&nbsp;X('.$info->xna_x.', '.$info->xna_y.', '.$info->xna_z.')' ?></td>
        </tr>
        <?php foreach ($model as $data): ?>
        <tr>
            <td colspan="6">
                <b>编号: <font color="#bb2222"><?= $data->xna_id ?></font></b>
            </td>
        </tr>
        <tr>
            <th>所在冰箱</th>
            <td><?= Yii::$app->params[$dnaOrRna.'_fridge'][$data->xna_fridge] ?></td>
            <th>所在位置</th>
            <td><?= $data->case.' A('.$data->case_a.', '.$data->case_b.')&nbsp;X('.$data->xna_x.', '.$data->xna_y.', '.$data->xna_z.')' ?></td>
            <th>浓度</th>
            <td><?= $data->xna_density." ng/nL" ?></td>
        </tr>
        <tr>
            <th>体积</th>
            <td><?= $data->xna_volumn." nL (剩余:".$data->xna_volumn_left." nL)" ?></td>
            <th>创建人</th>
            <td><?= $data->crt_name ?></td>
            <th>创建时间</th>
            <td><?= $data->crt_time ?></td>
        </tr>
        <?php foreach ($data->alter as $alter): ?>
        <tr><td colspan="6"></td></tr>
        <tr>
            <th>使用目的</th>
            <td><?= $alter->use_name ?></td>
            <th>使用数量</th>
            <td><?= $alter->use_num." nL" ?></td>
            <th>使用时间</th>
            <td><?= $alter->use_time ?></td>
        </tr>
        <tr>
            <th>初始浓度</th>
            <td><?= $alter->origin_density." ng/nL" ?></td>
            <th>创建人</th>
            <td><?= $alter->crt_name ?></td>
            <th>创建时间</th>
            <td><?= $alter->crt_time ?></td>
        </tr>
        <?php endforeach; ?>
        <?php endforeach; ?>
    </table>

</div>

